Skip to content

fix(multichain-account-service): do not report TimeoutError + static error messages#8249

Merged
ccharly merged 12 commits intomainfrom
cc/fix/filter-timeout-errors
Mar 20, 2026
Merged

fix(multichain-account-service): do not report TimeoutError + static error messages#8249
ccharly merged 12 commits intomainfrom
cc/fix/filter-timeout-errors

Conversation

@ccharly
Copy link
Contributor

@ccharly ccharly commented Mar 19, 2026

Explanation

The TimeoutError will naturally happen for some users, in case of network latency for example.

We have those mechanism in place to not make the service hang forever if anything goes wrong with a provider operation. The best thing we can do is to adjust them to a reasonable threshold value depending on the platform we are.

That being said, having some feedback on such errors could be useful, which is why we keep logging them. We only report other kind of errors to Sentry too!

Also changed some error messages to use a more "static pattern" for some errors and avoid having different "grouping" on Sentry for those messages (e.g when the error message was too "dynamic")

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Low risk: changes are limited to error reporting/logging behavior and timeout messaging, with broad test coverage added to lock in the new Sentry/console expectations.

Overview
Stops reporting TimeoutErrors to Sentry across provider operations (account creation, discovery, and resync), treating them as warnings while continuing to capture non-timeout errors.

Introduces a shared reportError helper (plus logErrorAs and isTimeoutError) to standardize static error messages/context for better Sentry grouping, and updates withTimeout to include the timeout duration in the thrown error message. Tests are extended to assert the new capture/console behavior in MultichainAccountService, MultichainAccountWallet, and SnapAccountProvider, and the changelog is updated accordingly.

Written by Cursor Bugbot for commit 663d9b7. This will update automatically on new commits. Configure here.

@ccharly ccharly marked this pull request as ready for review March 19, 2026 17:14
@ccharly ccharly requested review from a team as code owners March 19, 2026 17:14
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

);
this.#messenger.captureException?.(sentryError);

const errorMessage = `Unable to discover accounts with provider "${providerName}"`;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this message to unify with other messages we were reporting to Sentry. The providerName won't change a lot, so this won't mess up Sentry message grouping too much (it might just group those under the right provider, which is good IMO)

},
);
this.messenger.captureException?.(sentryError);
const errorMessage = 'Unable to re-sync accounts';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this to a more static message to avoid having different grouping for this message on Sentry. (the groupIndex was initially part of the message, thus the message was a bit "too dynamic").

We still have the groupIndex as part of the Sentry context, see below.

@ccharly ccharly changed the title fix(multichain-account-service): do not report TimeoutError fix(multichain-account-service): do not report TimeoutError + static error messages Mar 20, 2026
Copy link
Contributor

@mathieuartu mathieuartu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! Nice

@ccharly ccharly added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit 885d4be Mar 20, 2026
326 checks passed
@ccharly ccharly deleted the cc/fix/filter-timeout-errors branch March 20, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants